<?php

class Portfolio extends Controller {

	function Portfolio()
	{
		parent::Controller();	
        $this->load->model('portfoliomodel'); 
        $this->load->model('glossarymodel');
	}     
    
    function index()
    {
                                   
        //load page description
        $this->load->model('pageheadersmodel'); 
        $data["header"] = $this->pageheadersmodel->get_header('portfolio');

        //portfolio list    
        $data["list"]["controller"] = 'portfolio/view/';
        $data["list"]["items"] = $this->portfoliomodel->get_list();

        $this->load->view('website/default/head', array("document_title" => DOCUMENT_TITLE . "Portfolio"));  
        $this->load->view('website/default/header');  
        $this->load->view('website/portfolio/portfolio', $data);   
        $this->load->view('website/default/footer');   

    }
     
    function view($id = NULL)
    {

        //portfolio item
        $data["item"] = $this->portfoliomodel->get_item($id); 
        if (empty($data["item"])) show_404();             

        // portfolio images        
        $data["images"] = $this->portfoliomodel->get_images($id); 

        //products used in portfolio                                  
        $data["products"] = $this->portfoliomodel->get_products($id); 

        //portfolio list     
        $data["list"]["controller"] = 'portfolio/view/';
        $data["list"]["items"] = $this->portfoliomodel->get_list($id);

        $this->load->view('website/default/head', array("document_title" => DOCUMENT_TITLE . "Portfolio - " . $data["item"]["Name_Portfolio"]));  
        $this->load->view('website/default/header');  
        $this->load->view('website/portfolio/portfolio_detail', $data);   
        $this->load->view('website/default/footer');   

    }

}

/* End of file welcome.php */
/* Location: ./system/application/controllers/welcome.php */